package org.eddycar.jproyeddycar.contrato.vistas;

import org.eddycar.jproyeddycar.negocio.CargarReportes;
import org.eddycar.jproyeddycar.contrato.dao.DaoContratoEditable;
import org.eddycar.jproyeddycar.contrato.modelo.ContratoEditable;


public class BuscarContratoEditable extends javax.swing.JDialog {

    String cedula = "";

    public BuscarContratoEditable(String cedula) {
        super(new javax.swing.JFrame(), true);
        this.cedula = cedula;
        try {
            initComponents();
            DaoContratoEditable dce = new DaoContratoEditable();
            ContratoEditable ce = dce.buscarId(cedula);
            txtPrimera.setText("PRIMERA.-" + ce.getPrimero() + ce.getPrimero2() + ce.getPrimero3());
            txtSegunda.setText("SEGUNDA.-" + ce.getSegundo() + ce.getSegundo2());
            txtTercero.setText("TERCERA.-" + ce.getTercero() + ce.getTercero2());
            txtCuarto.setText("CUARTA" + ce.getCuarto() + ce.getCuarto2());
            txtVendedor4.setText(ce.getNombres());
            txtEtiquetas.setText(ce.getEtiquetas());
            txtCedVendedor1.setText(ce.getCedula());
            txtSeptimo.setText("SEPTIMA.-" + ce.getSeptimo());
            txtOctavo.setText("OCTAVA.-" + ce.getOctavo() + ce.getOctavo2());
            btnImprimir.setEnabled(true);
            setLocationRelativeTo(this);
            setAlwaysOnTop(true);
            setResizable(false);
            setVisible(true);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane4 = new javax.swing.JScrollPane();
        jScrollPane3 = new javax.swing.JScrollPane();
        jPanel2 = new javax.swing.JPanel();
        jLabel65 = new javax.swing.JLabel();
        jLabel70 = new javax.swing.JLabel();
        jScrollPane5 = new javax.swing.JScrollPane();
        txtPrimera = new javax.swing.JTextArea();
        jScrollPane6 = new javax.swing.JScrollPane();
        txtSegunda = new javax.swing.JTextArea();
        jScrollPane7 = new javax.swing.JScrollPane();
        txtTercero = new javax.swing.JTextArea();
        jPanel3 = new javax.swing.JPanel();
        jLabel71 = new javax.swing.JLabel();
        jLabel72 = new javax.swing.JLabel();
        jLabel73 = new javax.swing.JLabel();
        jLabel74 = new javax.swing.JLabel();
        jLabel75 = new javax.swing.JLabel();
        jLabel76 = new javax.swing.JLabel();
        jLabel77 = new javax.swing.JLabel();
        jLabel78 = new javax.swing.JLabel();
        jLabel79 = new javax.swing.JLabel();
        jLabel80 = new javax.swing.JLabel();
        jLabel81 = new javax.swing.JLabel();
        jLabel82 = new javax.swing.JLabel();
        jLabel83 = new javax.swing.JLabel();
        jScrollPane9 = new javax.swing.JScrollPane();
        txtCuarto = new javax.swing.JTextArea();
        txtVendedor4 = new javax.swing.JTextField();
        txtEtiquetas = new javax.swing.JTextField();
        btnImprimir = new javax.swing.JButton();
        txtCedVendedor1 = new javax.swing.JTextField();
        jScrollPane10 = new javax.swing.JScrollPane();
        txtOctavo = new javax.swing.JTextArea();
        jScrollPane11 = new javax.swing.JScrollPane();
        txtSeptimo = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setName("Form"); // NOI18N

        jScrollPane4.setName("jScrollPane4"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance().getContext().getResourceMap(BuscarContratoEditable.class);
        jPanel2.setBackground(resourceMap.getColor("jPanel2.background")); // NOI18N
        jPanel2.setForeground(resourceMap.getColor("jPanel2.foreground")); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jLabel65.setFont(new java.awt.Font("Arial 14 Negrita", 1, 18));
        jLabel65.setText(resourceMap.getString("jLabel65.text")); // NOI18N
        jLabel65.setName("jLabel65"); // NOI18N

        jLabel70.setFont(new java.awt.Font("Arial 14 Negrita 18 Negrita", 1, 18));
        jLabel70.setText(resourceMap.getString("jLabel70.text")); // NOI18N
        jLabel70.setName("jLabel70"); // NOI18N

        jScrollPane5.setName("jScrollPane5"); // NOI18N

        txtPrimera.setColumns(20);
        txtPrimera.setEditable(false);
        txtPrimera.setFont(resourceMap.getFont("txtOctavo.font")); // NOI18N
        txtPrimera.setLineWrap(true);
        txtPrimera.setRows(5);
        txtPrimera.setWrapStyleWord(true);
        txtPrimera.setName("txtPrimera"); // NOI18N
        jScrollPane5.setViewportView(txtPrimera);

        jScrollPane6.setName("jScrollPane6"); // NOI18N

        txtSegunda.setColumns(20);
        txtSegunda.setEditable(false);
        txtSegunda.setFont(resourceMap.getFont("txtOctavo.font")); // NOI18N
        txtSegunda.setLineWrap(true);
        txtSegunda.setRows(5);
        txtSegunda.setWrapStyleWord(true);
        txtSegunda.setName("txtSegunda"); // NOI18N
        jScrollPane6.setViewportView(txtSegunda);

        jScrollPane7.setName("jScrollPane7"); // NOI18N

        txtTercero.setColumns(20);
        txtTercero.setEditable(false);
        txtTercero.setFont(resourceMap.getFont("txtOctavo.font")); // NOI18N
        txtTercero.setLineWrap(true);
        txtTercero.setRows(5);
        txtTercero.setWrapStyleWord(true);
        txtTercero.setName("txtTercero"); // NOI18N
        jScrollPane7.setViewportView(txtTercero);

        jPanel3.setName("jPanel3"); // NOI18N

        jLabel71.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel71.setText(resourceMap.getString("jLabel71.text")); // NOI18N
        jLabel71.setName("jLabel71"); // NOI18N

        jLabel72.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel72.setText(resourceMap.getString("jLabel72.text")); // NOI18N
        jLabel72.setName("jLabel72"); // NOI18N

        jLabel73.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel73.setText(resourceMap.getString("jLabel73.text")); // NOI18N
        jLabel73.setName("jLabel73"); // NOI18N

        jLabel74.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel74.setText(resourceMap.getString("jLabel74.text")); // NOI18N
        jLabel74.setName("jLabel74"); // NOI18N

        jLabel75.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel75.setText(resourceMap.getString("jLabel75.text")); // NOI18N
        jLabel75.setName("jLabel75"); // NOI18N

        jLabel76.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel76.setText(resourceMap.getString("jLabel76.text")); // NOI18N
        jLabel76.setName("jLabel76"); // NOI18N

        jLabel77.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel77.setText(resourceMap.getString("jLabel77.text")); // NOI18N
        jLabel77.setName("jLabel77"); // NOI18N

        jLabel78.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel78.setText(resourceMap.getString("jLabel78.text")); // NOI18N
        jLabel78.setName("jLabel78"); // NOI18N

        jLabel79.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel79.setText(resourceMap.getString("jLabel79.text")); // NOI18N
        jLabel79.setName("jLabel79"); // NOI18N

        jLabel80.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel80.setText(resourceMap.getString("jLabel80.text")); // NOI18N
        jLabel80.setName("jLabel80"); // NOI18N

        jLabel81.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel81.setText(resourceMap.getString("jLabel81.text")); // NOI18N
        jLabel81.setName("jLabel81"); // NOI18N

        jLabel82.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel82.setText(resourceMap.getString("jLabel82.text")); // NOI18N
        jLabel82.setName("jLabel82"); // NOI18N

        jLabel83.setFont(resourceMap.getFont("jLabel78.font")); // NOI18N
        jLabel83.setText(resourceMap.getString("jLabel83.text")); // NOI18N
        jLabel83.setName("jLabel83"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel71)
                    .addComponent(jLabel72)
                    .addComponent(jLabel73)
                    .addComponent(jLabel74)
                    .addComponent(jLabel75)
                    .addComponent(jLabel76)
                    .addComponent(jLabel77)
                    .addComponent(jLabel78, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel79)
                    .addComponent(jLabel80)
                    .addComponent(jLabel81)
                    .addComponent(jLabel82)
                    .addComponent(jLabel83))
                .addContainerGap(7, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jLabel71)
                .addGap(6, 6, 6)
                .addComponent(jLabel72)
                .addGap(6, 6, 6)
                .addComponent(jLabel73)
                .addGap(6, 6, 6)
                .addComponent(jLabel74)
                .addGap(6, 6, 6)
                .addComponent(jLabel75)
                .addGap(6, 6, 6)
                .addComponent(jLabel76)
                .addGap(6, 6, 6)
                .addComponent(jLabel77)
                .addGap(6, 6, 6)
                .addComponent(jLabel78)
                .addGap(6, 6, 6)
                .addComponent(jLabel79)
                .addGap(6, 6, 6)
                .addComponent(jLabel80)
                .addGap(6, 6, 6)
                .addComponent(jLabel81)
                .addGap(6, 6, 6)
                .addComponent(jLabel82)
                .addGap(6, 6, 6)
                .addComponent(jLabel83))
        );

        jScrollPane9.setName("jScrollPane9"); // NOI18N

        txtCuarto.setColumns(20);
        txtCuarto.setEditable(false);
        txtCuarto.setFont(resourceMap.getFont("txtOctavo.font")); // NOI18N
        txtCuarto.setLineWrap(true);
        txtCuarto.setRows(5);
        txtCuarto.setWrapStyleWord(true);
        txtCuarto.setName("txtCuarto"); // NOI18N
        jScrollPane9.setViewportView(txtCuarto);

        txtVendedor4.setEditable(false);
        txtVendedor4.setName("txtVendedor4"); // NOI18N

        txtEtiquetas.setEditable(false);
        txtEtiquetas.setText(resourceMap.getString("txtEtiquetas.text")); // NOI18N
        txtEtiquetas.setName("txtEtiquetas"); // NOI18N

        btnImprimir.setText(resourceMap.getString("btnImprimir.text")); // NOI18N
        btnImprimir.setEnabled(false);
        btnImprimir.setName("btnImprimir"); // NOI18N
        btnImprimir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImprimirActionPerformed(evt);
            }
        });

        txtCedVendedor1.setEditable(false);
        txtCedVendedor1.setName("txtCedVendedor1"); // NOI18N

        jScrollPane10.setName("jScrollPane10"); // NOI18N

        txtOctavo.setColumns(20);
        txtOctavo.setEditable(false);
        txtOctavo.setFont(resourceMap.getFont("txtOctavo.font")); // NOI18N
        txtOctavo.setLineWrap(true);
        txtOctavo.setRows(5);
        txtOctavo.setWrapStyleWord(true);
        txtOctavo.setName("txtOctavo"); // NOI18N
        jScrollPane10.setViewportView(txtOctavo);

        jScrollPane11.setEnabled(false);
        jScrollPane11.setName("jScrollPane11"); // NOI18N

        txtSeptimo.setColumns(20);
        txtSeptimo.setEditable(false);
        txtSeptimo.setFont(resourceMap.getFont("txtOctavo.font")); // NOI18N
        txtSeptimo.setLineWrap(true);
        txtSeptimo.setRows(5);
        txtSeptimo.setWrapStyleWord(true);
        txtSeptimo.setAutoscrolls(false);
        txtSeptimo.setDisabledTextColor(resourceMap.getColor("txtSeptimo.disabledTextColor")); // NOI18N
        txtSeptimo.setEnabled(false);
        txtSeptimo.setMaximumSize(new java.awt.Dimension(104, 50));
        txtSeptimo.setMinimumSize(new java.awt.Dimension(104, 50));
        txtSeptimo.setName("txtSeptimo"); // NOI18N
        txtSeptimo.setPreferredSize(new java.awt.Dimension(224, 50));
        jScrollPane11.setViewportView(txtSeptimo);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(160, 160, 160)
                        .addComponent(jLabel65))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(220, 220, 220)
                        .addComponent(jLabel70))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(30, 30, 30)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jScrollPane10, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane11)
                            .addComponent(jPanel3, 0, 700, Short.MAX_VALUE)
                            .addComponent(jScrollPane9)
                            .addComponent(jScrollPane5)
                            .addComponent(jScrollPane6)
                            .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 700, Short.MAX_VALUE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(185, 185, 185)
                        .addComponent(txtEtiquetas, javax.swing.GroupLayout.PREFERRED_SIZE, 403, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(120, 120, 120)
                        .addComponent(txtVendedor4, javax.swing.GroupLayout.PREFERRED_SIZE, 534, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(157, 157, 157)
                        .addComponent(txtCedVendedor1, javax.swing.GroupLayout.PREFERRED_SIZE, 460, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(333, 333, 333)
                        .addComponent(btnImprimir, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(35, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addComponent(jLabel65)
                .addGap(8, 8, 8)
                .addComponent(jLabel70)
                .addGap(38, 38, 38)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(3, 3, 3)
                .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addComponent(txtEtiquetas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(txtVendedor4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtCedVendedor1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnImprimir)
                .addContainerGap())
        );

        jScrollPane3.setViewportView(jPanel2);

        jScrollPane4.setViewportView(jScrollPane3);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 787, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 568, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnImprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirActionPerformed
        CargarReportes report = new CargarReportes();
        report.llamarReporte(cedula, "contratoEditable1", "Ids");
        dispose();

}//GEN-LAST:event_btnImprimirActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnImprimir;
    private javax.swing.JLabel jLabel65;
    private javax.swing.JLabel jLabel70;
    private javax.swing.JLabel jLabel71;
    private javax.swing.JLabel jLabel72;
    private javax.swing.JLabel jLabel73;
    private javax.swing.JLabel jLabel74;
    private javax.swing.JLabel jLabel75;
    private javax.swing.JLabel jLabel76;
    private javax.swing.JLabel jLabel77;
    private javax.swing.JLabel jLabel78;
    private javax.swing.JLabel jLabel79;
    private javax.swing.JLabel jLabel80;
    private javax.swing.JLabel jLabel81;
    private javax.swing.JLabel jLabel82;
    private javax.swing.JLabel jLabel83;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTextField txtCedVendedor1;
    private javax.swing.JTextArea txtCuarto;
    private javax.swing.JTextField txtEtiquetas;
    private javax.swing.JTextArea txtOctavo;
    private javax.swing.JTextArea txtPrimera;
    private javax.swing.JTextArea txtSegunda;
    private javax.swing.JTextArea txtSeptimo;
    private javax.swing.JTextArea txtTercero;
    private javax.swing.JTextField txtVendedor4;
    // End of variables declaration//GEN-END:variables
}
